<template>
  <div class="header">
    <NavLeft />
    <Search />
    <NavRight />
  </div>
</template>

<script lang='ts'>
import { Component, Vue } from "nuxt-property-decorator";

@Component
export default class extends Vue {
  created() {
    this.initNav();
    this.initUserNav();
  }
  initNav() {
    //请求数据，将数据存进navModule
    this.$store.commit("navModule/initNav");
  }
  initUserNav() {
    this.$store.commit("navModule/initUserNav");
  }
}
</script>

<style lang='less' scoped>
.header {
  padding-left: 30px;
  padding-right: 30px;
  min-width: 1200px;
  .wh(100%, 48px);
  .flex-box(row, space-between, center);
  background-color: #fff;
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 5%);
  position: sticky;
  top: 0;
  z-index: 999;
}
</style>